﻿Public Class CanhBao_SoLuong

    Private Sub BarButtonItemLamTuoi_ItemClick_1(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItemLamTuoi.ItemClick
        If Me.RadioGroup1.SelectedIndex = 0 Then
            Me.GetTonKho_CanhBao_SoLuongToiDaTableAdapter.Fill(Me.PCV_CLINICDataSetTongHop.getTonKho_CanhBao_SoLuongToiDa, CDate(Me.TuNgayIDateEdit.EditValue), CDate(Me.DenNgayIDateEdit.EditValue))
            Me.IGridControl.DataSource = Me.PCV_CLINICDataSetTongHop.getTonKho_CanhBao_SoLuongToiDa
        Else
            Me.GetTonKho_CanhBao_SoLuongToiThieuTableAdapter.Fill(Me.PCV_CLINICDataSetTongHop.getTonKho_CanhBao_SoLuongToiThieu, CDate(Me.TuNgayIDateEdit.EditValue), CDate(Me.DenNgayIDateEdit.EditValue))
            Me.IGridControl.DataSource = Me.PCV_CLINICDataSetTongHop.getTonKho_CanhBao_SoLuongToiThieu
        End If
    End Sub

    Private Sub CanhBao_SoLuong_Load(sender As Object, e As EventArgs) Handles Me.Load
        Me.TuNgayIDateEdit.EditValue = getNgayDauThang(Today)
        Me.DenNgayIDateEdit.EditValue = getNgayCuoiThang(Today)
        Me.coltonkhotoithieu.Visible = False
        Me.coltonkhotoida.Visible = True
    End Sub

    Private Sub RadioGroup1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles RadioGroup1.SelectedIndexChanged
        If Me.RadioGroup1.SelectedIndex = 0 Then
            Me.coltonkhotoithieu.Visible = False
            Me.coltonkhotoida.Visible = True
            Me.GetTonKho_CanhBao_SoLuongToiDaTableAdapter.Fill(Me.PCV_CLINICDataSetTongHop.getTonKho_CanhBao_SoLuongToiDa, CDate(Me.TuNgayIDateEdit.EditValue), CDate(Me.DenNgayIDateEdit.EditValue))
            Me.IGridControl.DataSource = Me.PCV_CLINICDataSetTongHop.getTonKho_CanhBao_SoLuongToiDa
        Else
            Me.coltonkhotoithieu.Visible = True
            Me.coltonkhotoida.Visible = False
            Me.GetTonKho_CanhBao_SoLuongToiThieuTableAdapter.Fill(Me.PCV_CLINICDataSetTongHop.getTonKho_CanhBao_SoLuongToiThieu, CDate(Me.TuNgayIDateEdit.EditValue), CDate(Me.DenNgayIDateEdit.EditValue))
            Me.IGridControl.DataSource = Me.PCV_CLINICDataSetTongHop.getTonKho_CanhBao_SoLuongToiThieu
        End If
    End Sub
End Class
